package com.cn.组件条件注册;
import org.springframework.context.annotation.Condition;
import org.springframework.context.annotation.ConditionContext;
import org.springframework.core.type.AnnotatedTypeMetadata;
import org.springframework.core.type.StandardMethodMetadata;

/**
 * @Auther: 代理仁
 * @Date: 2019/7/7 22:43
 * @Description:偶数条件
 */
public class OuShuCondition implements Condition {

    @Override
    public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) {
        StandardMethodMetadata standardMethodMetadata = (StandardMethodMetadata)metadata;
        if(standardMethodMetadata.getMethodName().endsWith("oushu")){
            return true;
        }
        return false;
    }
}
